package org.footballmanager.pandafootball.system.form.impl;

import lombok.Getter;
import lombok.Setter;
import org.footballmanager.pandafootball.system.domain.FootTax;
import org.footballmanager.pandafootball.system.form.SearchForm;
import org.springframework.util.StringUtils;
import tk.mybatis.mapper.entity.Example;

import java.io.Serializable;

@Setter
@Getter
public class FootTaxSearchForm extends SearchForm implements Serializable {
    private static final long serialVersionUID = 8090668615941861543L;
    protected String fsmc;

    public Example buildSearchCommond() {
        Example example = new Example(FootTax.class);
        Example.Criteria criteria = example.createCriteria();
        if (!StringUtils.isEmpty(fsmc)) {
            criteria.andLike("fsmc", "%" + fsmc.trim() + "%");
            Example.Criteria criteria2 = example.createCriteria();
            criteria2.andLike("sid", "%" + fsmc.trim() + "%");
            example.or(criteria2);
        }
        criteria.andEqualTo("delFlag", 0);
        example.orderBy("fsmc").desc();
        return example;
    }

}
